<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/jquery-3.2.1.min.js"></script>
</head>
<body>
    <p><a href="http://www.runoob.com" id="runoob">菜鸟教程</a></p>
    <button id="show">显示 href 属性的值</button>
    <button id="update">修改href的值</button>

    <script>
        $(function () {
            $('#show').click(function () {
                alert($('#runoob').attr("href"))
            });
            $('#update').click(function () {
                $('#runoob').attr("href","http://jquery.cuishifeng.cn/jQuery.Ajax.html")
            })
        })
    </script>
</body>
</html>